/*
 * Copyright (C) 2021 Fastjrun, Inc. All Rights Reserved.
 */
package com.fastjrun.xxl.job.api.helper;

import com.fastjrun.xxl.job.api.entity.XxlJobInfo;
import com.fastjrun.xxl.job.api.vo.XxlJobInfoVO;

public class EntityToVOConverter {
  public static final XxlJobInfoVO convert(XxlJobInfo xxlJobInfo) {
    XxlJobInfoVO xxlJobInfoVO = new XxlJobInfoVO();
    xxlJobInfoVO.setJobGroup(xxlJobInfo.getJobGroup());
    xxlJobInfoVO.setJobDesc(xxlJobInfo.getJobDesc());
    xxlJobInfoVO.setAuthor(xxlJobInfo.getAuthor());

    xxlJobInfoVO.setScheduleType(xxlJobInfo.getScheduleType());
    xxlJobInfoVO.setScheduleConf(xxlJobInfo.getScheduleConf());

    xxlJobInfoVO.setGlueType(xxlJobInfo.getGlueType());
    xxlJobInfoVO.setExecutorHandler(xxlJobInfo.getExecutorHandler());
    xxlJobInfoVO.setGlueSource(xxlJobInfo.getGlueSource());
    xxlJobInfoVO.setExecutorRouteStrategy(xxlJobInfo.getExecutorRouteStrategy());
    xxlJobInfoVO.setMisfireStrategy(xxlJobInfo.getMisfireStrategy());
    xxlJobInfoVO.setExecutorBlockStrategy(xxlJobInfo.getExecutorBlockStrategy());

    xxlJobInfoVO.setChildJobId(xxlJobInfo.getChildJobid());

    xxlJobInfoVO.setId(xxlJobInfo.getId());
    xxlJobInfoVO.setAlarmEmail(xxlJobInfo.getAlarmEmail());
    xxlJobInfoVO.setExecutorParam(xxlJobInfo.getExecutorParam());
    xxlJobInfoVO.setExecutorTimeout(xxlJobInfo.getExecutorTimeout());
    xxlJobInfoVO.setExecutorFailRetryCount(xxlJobInfo.getExecutorFailRetryCount());
    xxlJobInfoVO.setGlueRemark(xxlJobInfo.getGlueRemark());

    xxlJobInfoVO.setTriggerStatus(xxlJobInfo.getTriggerStatus());
    xxlJobInfoVO.setTriggerLastTime(xxlJobInfo.getTriggerLastTime());
    xxlJobInfoVO.setTriggerNextTime(xxlJobInfo.getTriggerNextTime());

    xxlJobInfoVO.setGlueUpdatetime(xxlJobInfo.getGlueUpdatetime());
    xxlJobInfoVO.setUpdateTime(xxlJobInfo.getUpdateTime());
    xxlJobInfoVO.setAddTime(xxlJobInfo.getAddTime());

    return xxlJobInfoVO;
  }
}
